import React, { useContext } from 'react';
import Context from '../context'
import { Contex2 } from '../context'
console.log(Context)
class GSon extends React.Component {
  static contextType = Context
  render() {
    console.log(this)
    return <div className=''>
      <h4>孙子--展示祖宗名字{this.context.p_name}</h4>
    </div>;
  }
}

function GSon2() {
  let c1 = useContext(Context)
  let c2 = useContext(Contex2)
  return <div className=''>
    <h4>孙子--展示祖宗名字{c1.p_name} -- {c2.qq}</h4>
  </div>;
}
export default GSon2